package com.muyu.system.domain.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Administrator
 */
@Getter
@AllArgsConstructor
public enum AuditStatusEnum {

    APPROVED(1, "通过"),
    REJECTED(2, "审核拒绝");


    @EnumValue
    @JsonValue
    private final int code;

    private final String name;


    @JsonCreator
    public static AuditStatusEnum getByCode(int code) {
        for (AuditStatusEnum auditStatusEnum : AuditStatusEnum.values()) {
            if (auditStatusEnum.getCode() == code) {
                return auditStatusEnum;
            }
        }
        return null;
    }
}
